﻿<Pages:AudioBasePage 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
                     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                     xmlns:Pages="clr-namespace:Samples.Radio.Pages"
                     xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                     xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                     xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
                     mc:Ignorable="d"
                     d:DesignWidth="480"
                     d:DesignHeight="800"
                    DataContext="{Binding Podcast, Source={StaticResource Locator}}"
                    x:Class="Samples.Radio.Pages.Program.PodcastPage"
                    Style="{StaticResource TransitionPageStyle}">


	<!--LayoutRoot is the root grid where all page content is placed-->
	<Grid x:Name="LayoutRoot" Background="Transparent"
          d:DataContext="{Binding SelectedPodcast, Source={StaticResource PodcastPageSampleData}}">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>
		
		<!--TitlePanel contains the name of the application and page title-->
		<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
			<TextBlock x:Name="ApplicationTitle" Text="{StaticResource Podcast}" Style="{StaticResource PhoneTextNormalStyle}" Foreground="{StaticResource BrandColour1Brush}"/>
			<TextBlock x:Name="PageTitle" Text="{Binding ProgramName}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
		</StackPanel>

		<!--ContentPanel - place additional content here-->
		<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
			<StackPanel x:Name="SP_PodcastDetails"
				Margin="0,0,12,0" d:LayoutOverrides="Width, Height">
				<TextBlock TextWrapping="Wrap"
					Style="{StaticResource PhoneTextTitle2Style}"
					Foreground="{StaticResource PhoneForegroundBrush}" Margin="12,-12,12,0" 
                           Text="{StaticResource Podcast}" />
                
                <Grid 
    		DataContext="{Binding SelectedPodcast}"
    		Background="{StaticResource BrandColour1Brush}" 
					Margin="{StaticResource PhoneHorizontalMargin}"
											>
                    <Image
    			HorizontalAlignment="Left" 
    			Source="{Binding ProgramImage}" VerticalAlignment="Bottom" Stretch="None" />
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" MinHeight="27"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBlock HorizontalAlignment="Right" TextWrapping="Wrap" 
    				Text="{Binding PodcastAge}" Style="{StaticResource PhoneTextNormalStyle}"
    				Margin="12,0,12,2" d:LayoutOverrides="Height"
    				VerticalAlignment="Top"
													/>
                        <Grid Grid.Row="1" VerticalAlignment="Bottom">
                            <Border Opacity="0.5"
    					Margin="0"
    					Background="Black" />
                            <StackPanel Margin="12,0,12,12"
    					Orientation="Vertical"
    					VerticalAlignment="Bottom">
                                <TextBlock TextWrapping="Wrap"
    						Text="{Binding ProgramName, ConverterParameter=upper, Converter={StaticResource CaseConverter}}"
    						Style="{StaticResource PhoneTextExtraLargeStyle}"
    						Margin="0"
    						HorizontalAlignment="Right"
    						Foreground="#DEFFFFFF" TextAlignment="Right" 
    						FontSize="{StaticResource PhoneFontSizeLarge}" 
															/>
                                <TextBlock TextWrapping="Wrap"
    						Text="{Binding Description}"
    						Style="{StaticResource PhoneTextTitle3Style}"
    						Margin="0"
    						HorizontalAlignment="Right"
    						TextAlignment="Right"
    						Foreground="#DEFFFFFF" />
                            </StackPanel>
                        </Grid>
                    </Grid>
                </Grid>

                <TextBlock TextWrapping="Wrap"
					Style="{StaticResource PhoneTextTitle2Style}"
					Foreground="{StaticResource PhoneForegroundBrush}" Margin="12,12,12,0" 
                           Text="{StaticResource Program}" />
				<StackPanel x:Name="SP_Program1"
					Margin="12,0"
					Visibility="{Binding HasCurrentProgram, Converter={StaticResource BooleanToVisibilityConverter}}"
					Background="{StaticResource BrandColour1Brush}">
                    <Button DataContext="{Binding CurrentProgram}"
						Style="{StaticResource ProgramInfoButtonStyle}"
						VerticalAlignment="Top" Background="{x:Null}" 
						ContentTemplate="{StaticResource ProgramInfoDataTemplate}"
						Content="{Binding}"
					>
						<i:Interaction.Triggers>
							<i:EventTrigger EventName="Click">
                                <ec:NavigateToPageAction>
                                    <ec:NavigateToPageAction.TargetPage>
                                        <Binding Path="ProgramName" StringFormat="/ProgramPage/{0}"/>
                                    </ec:NavigateToPageAction.TargetPage>
                                </ec:NavigateToPageAction>
                            </i:EventTrigger>
						</i:Interaction.Triggers>
					</Button>
				</StackPanel>
			</StackPanel>
		</Grid>
    </Grid>
</Pages:AudioBasePage>